package logic

import (
	"context"
	"short-video/short-video-rpc/proto/video"
	"short-video/short-video-service/server"
)

type VideoServer struct {
	video.UnimplementedVideoServer
}

func (VideoServer) UserLogin(ctx context.Context, in *video.UserLoginReq) (*video.UserLoginResp, error) {
	login, err := server.UserLogin(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (VideoServer) SendSms(ctx context.Context, in *video.SendSmseq) (*video.SendSmsResp, error) {
	sms, err := server.SendSms(in)
	if err != nil {
		return nil, err
	}
	return sms, nil
}

func (VideoServer) UserFind(ctx context.Context, in *video.UserFindReq) (*video.UserFindResp, error) {
	find, err := server.UserFind(in)
	if err != nil {
		return nil, err
	}
	return find, nil
}

func (VideoServer) VideoUpload(ctx context.Context, in *video.VideoUploadReq) (*video.VideoUploadResp, error) {
	upload, err := server.VideoUpload(in)
	if err != nil {
		return nil, err
	}
	return upload, nil
}

func (VideoServer) VideoTopic(ctx context.Context, in *video.VideoTopicReq) (*video.VideoTopicResp, error) {
	topic, err := server.VideoTopic(in)
	if err != nil {
		return nil, err
	}
	return topic, nil
}

func (VideoServer) VideoCreate(ctx context.Context, in *video.VideoCreateReq) (*video.VideoCreateResp, error) {
	create, err := server.VideoCreate(in)
	if err != nil {
		return nil, err
	}
	return create, nil
}

func (VideoServer) VideoList(ctx context.Context, in *video.VideoListReq) (*video.VideoListResp, error) {
	list, err := server.VideoList(in)
	if err != nil {
		return nil, err
	}
	return list, nil
}

func (VideoServer) VideoLikes(ctx context.Context, in *video.VideoLikesReq) (*video.VideoLikesResp, error) {
	likes, err := server.VideoLikes(in)
	if err != nil {
		return nil, err
	}
	return likes, nil
}

func (VideoServer) VideoLikej(ctx context.Context, in *video.VideoLikejReq) (*video.VideoLikejResp, error) {
	likej, err := server.VideoLikej(in)
	if err != nil {
		return nil, err
	}
	return likej, nil
}
